home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / diskmags / 0022-3.564 / dmg-3421 / stos / stos_2.txt / stos_2.txt
Text File  |  1997-06-21  |  5KB  |  136 lines

  1. STOS LESSON 2
  2. ----------------------------------------------------------------
  3.  
  4. NN    NN EEEEEEE TTTTTTTT WW         WW   OOOOO   RRRRR  KK   KK 
  5. NNN   NN EE         TT    WW         WW OO     OO RR  RR KK  KK
  6. NN N  NN EEEEE      TT    WW    W    WW OO     OO RR  RR KKKK 
  7. NN  N NN EE         TT    WW   WWW   WW OO     OO RRRR   KK  KK
  8. NN   NNN EE         TT     WW WW WW WW  OO     OO RR  RR KK   KK 
  9. NN    NN EEEEEEE    TT      WWW   WWW     OOOOO   RR  RR KK   KK
  10.    
  11. THE CYBERPUNKS STOS LESSON PART 2                      (PD) 1992
  12.  
  13. -----------------------------------------------------------------
  14.  
  15. This time we shall take a closer look at the scrolling routine in 
  16. the beginning of the first interlude in the S-Extension demo.  As 
  17. that  routine is rather short i have included four  other  little 
  18. progs  called  fun1-4.  I'll tell more about them  after  i  have 
  19. explained how the scroll works.
  20.  
  21. The  Scroll works by moving the screen with the  Physic=  command 
  22. which  moves the screens addresse in steps of  256  bytes.  There 
  23. are  some problems with this command,  firstly if you  moves  the 
  24. screen  by  256 bytes it will jump sideways  and  not  downwards, 
  25. secondly  you have a problem with the standard screen  format  as 
  26. it  saves  the palette right below the screen  data,  moving  the 
  27. screen  address  will  therefore make the  palette  data  visible 
  28. (garbage  in  the  lower part of the screen  (this  problem  also 
  29. occurs if you removes the borders)). 
  30.  
  31. The  solution to the first problem is to move the screen  address 
  32. by steps of 1280 bytes which equals 8 screen lines. 
  33.  
  34. The solution to  the second problem is to use the copy command to 
  35. copy raw screen data into normal databanks (not datascreens).  By 
  36. doing that you avoids coping the palette data.  
  37.  
  38. -----------------------------------------------------------------
  39.  
  40. In  this routine i use two banks at 33920bytes each,  the  reason 
  41. for using two banks is to scroll smother than the normal 8  lines 
  42. a update. 
  43.  
  44. (a 4 bitplane full screen scroll text needs 64kb + Block size * 2)
  45.  
  46.  
  47. - Standard startup + palette setup and shift speed for the  false 
  48.   parallax effect.
  49.  
  50. 10 mode 0 : flash off 
  51. 20 palette $0,$3,$4,$115,$226,$337,$247,$760,$425,$536,$536,
  52. $536,$757,$647,$647,$647
  53. 30 shift 2,8
  54.  
  55. - Reserves the two 'Screens'.  Notice that they are larger  than 
  56.   normal screens.
  57.  
  58. 40 reserve as work 8,33920
  59. 50 reserve as work 7,33920
  60.  
  61. - Copies  the  graphics in bank 6 to bank 8 and  7.  Notice  that 
  62.   screen   7  are  copied   from   screen  8   with   640   bytes   
  63.   difference. 640 bytes is the half of 1280 (see later). The size   
  64.   of the graphic in bank 6 is 2560 bytes, (1280+1280=2560)
  65.  
  66. 60 for I=start(8) to start(8)+34560 step 2560
  67. 70 copy start(6),start(6)+2560 to I
  68. 80 next I
  69. 90 copy start(8)+640,start(8)+length(8) to start(7)
  70.  
  71. - And this is it,  the main loop.  Not much is it,  but holy shit 
  72.   does it look impressive in basic.
  73.  
  74.   Look how  each screen is  used twice but with a  difference  of 
  75.   1280 bytes.  1280 bytes is  the same as 8 screen lines and  the 
  76.   minimum  you can  move if you want to  move  without  scrolling 
  77.   sideways.  By  switching  between the two screens  that  has  a 
  78.   difference  of 4 lines (640bytes)  i can scroll by  4  lines  a 
  79.   update  which are half of what you normally can do by  swapping 
  80.   screen address.
  81.  
  82. 100 repeat 
  83. 110 physic=start(8) : wait vbl 
  84. 120 physic=start(7) : wait vbl 
  85. 130 physic=start(8)+1280 : wait vbl 
  86. 140 physic=start(7)+1280 : wait vbl 
  87. 150 until inkey$=" "
  88.  
  89. -  Erases  bank 7 and 8:  not necessary here but  useful  in  the 
  90.    original demo. 
  91.  
  92. 160 erase 7 : erase 8 : default
  93.  
  94. As you might have noticed,  this routine does not scroll at  all, 
  95. it  just  jumps  back and fort in the  two  banks.  The  standard 
  96. 'Screen  filed with equal looking squares that can scroll in  any 
  97. direction  demo'  uses a more  advanced version  of  this  little 
  98. trick.
  99.  
  100. Next  time you will find the entire code,  graphic and sound  for 
  101. the 'It can be done, easily' demo from 'S-EXTENSION V1.1: THE STE 
  102. EXTENDED REMIX' and an explanation of why it goes at 25htz  while 
  103. Colins goes at 50htz. (Its rather easy to speed it up)
  104.  
  105. -----------------------------------------------------------------     
  106.  
  107. But now lets have some fun!
  108.  
  109. Fun1.bas:  This  prog  is ,if i can  remember  right,  a  distort 
  110. screen routine that you can control with the mouse
  111.     
  112. Fun2.bas:  Is a preset distort routine, move the mouse pointer to 
  113. the upper and middle part of the screen and see what happens.
  114.  
  115. Fun3.bas: This is a striped down version of the first demo i made 
  116. in  STOS (never released) it had a sample and used  several  pics 
  117. from Tenage Queen.
  118.  
  119. Fun4.bas:  Is a FX rut for the main scroll screen in S-EXTENSION, 
  120. (which  again  is a direct result of how people  reacted  to  the 
  121. first  demo (fun3).  Read about it in the intro text to the  main 
  122. S-EXTENSION scroll text, printed in this or the next mag.)
  123.  
  124. The picture that the FUN files uses is one of the few pictures  i 
  125. have drawn freehand lately (except for my game). 
  126.  
  127. Well  this  is the end,  have a STOSing good time  till  we  meet 
  128. again.
  129.  
  130. Signing off
  131.  
  132. Cyberpunk of Network.
  133.  
  134.     
  135.  
  136.